Eclipse Platform
Pre-release 3.0

org.eclipse.jface.text.source
Interface IAnnotationModelExtension

All Known Implementing Classes:
AnnotationModel

public interface IAnnotationModelExtension

Extends IAnnotationModel with the ability to attach additional annotation models to it.

Since:
3.0

Method Summary
 void addAnnotationModel(Object key, IAnnotationModel attachment)
          Attaches attachment to the receiver.
 IAnnotationModel getAnnotationModel(Object key)
          Returns the attached IAnnotationModel for key, or null if none is attached for key.
 IAnnotationModel removeAnnotationModel(Object key)
          Removes and returns the attached IAnnotationModel for key.
 void replaceAnnotations(Annotation[] annotationsToRemove, Map annotationsToAdd)
          Replaces annotations with new annotations for this annotation model.
 

Method Detail

addAnnotationModel

public void addAnnotationModel(Object key,
                               IAnnotationModel attachment)
Attaches attachment to the receiver. Connects attachment to the currently connected document. If attachment is already attached (even) under a different key), it is not attached again.

Parameters:
key - the key through which the attachment is identified.
attachment - the attached IAnnotationModel

getAnnotationModel

public IAnnotationModel getAnnotationModel(Object key)
Returns the attached IAnnotationModel for key, or null if none is attached for key.

Parameters:
key - the key through which the attachment is identified.
Returns:
an IAnnotationModel attached under key, or null

removeAnnotationModel

public IAnnotationModel removeAnnotationModel(Object key)
Removes and returns the attached IAnnotationModel for key.

Parameters:
key - the key through which the attachment is identified.
Returns:
an IAnnotationModel attached under key, or null

replaceAnnotations

public void replaceAnnotations(Annotation[] annotationsToRemove,
                               Map annotationsToAdd)
                        throws ClassCastException
Replaces annotations with new annotations for this annotation model. The new annotations are map entries where the annotation is the key and the value is the position for the annotation. Each position describes the range covered by the annotation. All registered annotation model listeners are informed about the change (if any). If the model is connected to a document, the positions are automatically updated on document changes. For each annotation which is already managed by this annotation model or is not associated with a valid position in the connected document nothing happens.

Parameters:
annotationsToRemove - the annotations to be removed, may be null
annotationsToAdd - the annotations which will be added, may be null each map entry has an Annotation as key and a Position as value
Throws:
ClassCastException - if one of the map key or values has a wrong type

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.